package com.app.manage.moudles.app.service;

import com.app.manage.moudles.app.po.AppServerPo;
import com.app.manage.moudles.app.vo.AppLogVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.app.manage.moudles.app.entity.TApp;

import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

/**
 * (TApp)表服务接口
 *
 * @author makejava
 * @since 2025-05-16 11:18:26
 */
public interface TAppService extends IService<TApp> {


    /**
     * 分页
     * @param pageNum
     * @param pageSize
     * @param app
     * @return
     */
    Object pageData(Integer pageNum,Integer pageSize,TApp app);

    /**
     * 保存
     * @param map
     * @return
     */
    String saveData(Map<String,Object> map);

    /**
     * 批量删除
     * @param idList
     * @return
     */
    <T>String  removeBatch(List<T> idList);

    /**
     * 查询
     * @param id
     * @return
     */
    Object getAppById(Integer id);

    /**
     * 获取到详情
     * @param id
     * @return
     */
    Object getDetail(Integer id);


    /**
     * 获取到应用日志
     * @param id
     * @return
     */
    AppLogVo getAppLogVo(Integer id);

    /**
     * 根据应用名称查询
     * @param jarNameList
     * @return
     */
    Map<String,TApp>  findAppByJarNames(List<String> jarNameList);


    /**
     * 查询服务器应用
     * @param appId
     * @return
     */
    List<Map<String,Object>> listAppServerVo(Integer appId);


    /**
     * 启动
     * @param appServerIdList
     * @return
     */
    String startCmd(List<Integer> appServerIdList);

    /**
     * 停止
     * @param appServerIdList
     * @return
     */
    String stopCmd(List<Integer> appServerIdList);

    /**
     * 重启
     * @param appServerIdList
     * @return
     */
    String reStart(List<Integer> appServerIdList);

    /**
     * 批量下载日志文件
     * @param appServerIdList
     * @param nextPath
     */
    void  downLog(List<Integer> appServerIdList, String nextPath, HttpServletResponse response);

}

